import net.sf.jasperreports.engine.JasperCompileManager;

import java.io.File;
import java.net.URISyntaxException;


/**
 * 将jsxml --> jsaper
 * 生成的文件位于 target/classes/jrxml/ds_jdbc.jasper
 */
public class Xml2Jasper {

    private static final String jrxmlFile = "/jrxml/ds_jdbc.jrxml";
    private static File DIR = null;

    static {
        try {
            DIR = new File(Xml2Jasper.class.getResource("/").toURI());
        } catch (URISyntaxException e) {
            e.printStackTrace();
        }
    }

    public static void compile() throws Exception {
        JasperCompileManager.compileReportToFile(DIR + jrxmlFile);
    }


    public static void main(String[] args) throws Exception {
        compile();
    }

}